<!DOCTYPE html>
<html>
<head>
<script src="static/js/jquery-1.11.2.js"></script>
<script src="static/js/bootstrap.min.js" ></script>
<script type="text/javascript">
$('document').ready(function () {
	navigator.getUserMedia || 
    (navigator.getUserMedia = navigator.mozGetUserMedia ||  navigator.webkitGetUserMedia || navigator.msGetUserMedia);

	if (navigator.getUserMedia) {
    //do something
	} else {
    	console.log('your browser not support getUserMedia');
	}
	$('#show').click(function () {
		navigator.getUserMedia({
        video: true,
        audio: true
    	}, onSuccess, onError);
    	function onSuccess(stream) {
    		console.log(stream);
    		if (window.URL) {
            $('#video').attr('src',window.URL.createObjectURL(stream));
        } else {
            $('#video').attr('src',stream);
        }
    	}
    	function onError() {}
	})
	var myVideo=document.getElementById("video");
	myVideo.play();
})
</script>
<meta charset="utf-8" />
<title>cantest</title>
</head>
<body>
<video id="video"></video>
<button class="btn default-btn" id="show">show</button>
</body>
</html>